package main

import "fmt"

type A struct {
	a string
	b string
}

type B struct {
	a string
	b string
}

//多继承
type C struct {
	A
	B
	int
}

type D struct {
	a int
	b string
	c B //组合类型
}

func main() {
	var c C
	c.A.a = "a"
	c.A.b = "b"
	c.B.a = "c"
	c.B.b = "d"
	fmt.Println(c)

	c2 := C{
		A{
			a: "a",
			b: "b"},
		B{
			a: "c",
			b: "d"},
		888}
	fmt.Println(c2)

	var d D
	d.a = 1
	d.b = "b"
	d.c.a = "c"
	d.c.b = "d"
	fmt.Println(d)
}
